﻿using SalesController.ClassesDB;
using SalesModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SalesController
{
    [Serializable]
    public class CashierDB
    {
        DAOFactory daoFactory = null;
        DAOEmployee daoEmployee = null;
        public CashierDB()
        {
            daoFactory = DAOFactory.getDAOFactory(DBConnection.dbType);
            daoEmployee = daoFactory.getDAOEmployee(); //Polimorfismo
        }
        public List<Cashier> Values
        {
            get { return daoEmployee.queryAllCashier(); }
        }
        public void Add(Cashier c)
        {
            daoEmployee.addCashier(c);
        }
        public void Delete(int id)
        {
            daoEmployee.deleteCashier(id);
        }
        public Cashier getCashierById(int idCashier)
        {
            return daoEmployee.queryByIdCashier(idCashier);
        }
    }
}
